int maxArea(vector<int> &height) {
        int i=0,j=height.size()-1,result = 0;
        while(i<j){
            result = height[i]>=height[j] ? max(result,(j-i)*height[j--]) : max(result, (j-i)*height[i++]);
        }
        return result;
    }